<template>
    <div class="pdf-show-box" v-loading="!url">
      <iframe width="100%" height="100%" :src="pdfSrc"></iframe>
    </div>
</template>

<script>
export default {
  name: 'pdfJsIframe',
  props: {
    url: {
      type: String,
      default: ''
    },
    fileName: {
      type: String
    }
  },
  computed: {
    pdfSrc () {
      // return './pdfjs/es5/web/viewer.html?file=' + encodeURIComponent(this.url + '&saveName=' + this.fileName)
      return './pdfjs/es5/web/viewerDy.html?file=' + encodeURIComponent(this.url + '#fileName=' + this.fileName)
    }
  }
}
</script>

<style lang="scss" scoped>
.pdf-show-box{
  width: 100%;
  height: 100%;
}
</style>
